package com.jie.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope       //作用：用来不需要重启微服务的情况下，将当前scope域中信息刷新为最新配置信息
public class DemoController {

    @Value("${name}")
    private String name;

    @GetMapping("/demo")
    public String demo(){
        System.out.println("demo ok!!!");

        return "Demo ok!!!"+name;
    }
}
